maqueenCalliope.irEvent(function (message) {
    serial.writeLine("recv ir:" + message)
})
maqueenCalliope.setColor(0xff0000)
maqueenCalliope.writeLED(maqueenCalliope.Led.LedAll, maqueenCalliope.LedSwitch.LedOn)
basic.pause(2000)
basic.forever(function () {
    serial.writeLine("led off, motor run !!!")
    maqueenCalliope.writeLED(maqueenCalliope.Led.LedAll, maqueenCalliope.LedSwitch.LedOff)
    maqueenCalliope.motorRun(maqueenCalliope.Motors.All, maqueenCalliope.Dir.CW, 255)
    basic.pause(1000)
    maqueenCalliope.motorRun(maqueenCalliope.Motors.All, maqueenCalliope.Dir.CCW, 255)
    basic.pause(1000)
    serial.writeLine("motor stop !!!")
    maqueenCalliope.motorStop(maqueenCalliope.Motors.All)
    basic.pause(1000)
    serial.writeLine("version:" + maqueenCalliope.getVersion())
    serial.writeLine("left line tracking status:" + maqueenCalliope.readPatrol(maqueenCalliope.Patrol.PatrolLeft))
    serial.writeLine("right line tracking status:" + maqueenCalliope.readPatrol(maqueenCalliope.Patrol.PatrolRight))
    serial.writeLine("servo run")
    maqueenCalliope.servoRun(maqueenCalliope.Servos.S1, 90)
    maqueenCalliope.servoRun(maqueenCalliope.Servos.S2, 90)
    basic.pause(1000)
    maqueenCalliope.servoRun(maqueenCalliope.Servos.S1, 180)
    maqueenCalliope.servoRun(maqueenCalliope.Servos.S2, 180)
    basic.pause(1000)
})
